


<Steps>
<Step title="Google Cloud SDK Setup">



1. Install the [Google Cloud SDK](https://cloud.google.com/sdk/docs/install)
2. Run `gcloud init` to configure your account and project

</Step>

<Step title="GCS Permissions">



Ensure your account has sufficient permissions (e.g., Storage Admin) to create and manage GCS buckets:

```bash
gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
    --member="user:YOUR_EMAIL@example.com" \
    --role="roles/storage.admin"
```

</Step>

<Step title="Authentication">



Use default credentials from your gcloud CLI session:

```bash
gcloud auth application-default login
```

Alternatively, if using a service account, set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the path of your service account JSON file.

</Step>

<Step title="Python Dependencies">
    
Install the required Python packages:

```bash
pip install google-auth google-cloud-storage openai ddgs
```

</Step>

</Steps>



<Steps title="Local Testing with Fake GCS">

<Step title="Setup with Docker">

For local testing without using real GCS, you can use [fake-gcs-server](https://github.com/fsouza/fake-gcs-server).


Create a `docker-compose.yml` file:

```yaml
version: '3.8'
services:
  fake-gcs-server:
    image: fsouza/fake-gcs-server:latest
    ports:
      - "4443:4443"
    command: ["-scheme", "http", "-port", "4443", "-public-host", "localhost"]
    volumes:
      - ./fake-gcs-data:/data
```

Start the fake GCS server:

```bash
docker-compose up -d
```

</Step>

<Step title="Using Fake GCS with Docker">

Set the environment variable to direct API calls to the emulator:

```bash
export STORAGE_EMULATOR_HOST="http://localhost:4443"
python gcs_for_agent.py
```

When using Fake GCS, authentication isn't enforced and the client will automatically detect the emulator endpoint.

</Step>

</Steps>
